home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / CHECK2.ASM < prev    next >
Assembly Source File  |  1993-05-04  |  1KB  |  44 lines

  1. ;******************************************;
  2. ; WASM Checksum Calculation, Standard Byte ;
  3. ; By Eric Tauck                            ;
  4. ;                                          ;
  5. ; Defines:                                 ;
  6. ;                                          ;
  7. ;   SumRes  reset checksum                 ;
  8. ;   SumCur  return current checksum        ;
  9. ;   SumUpd  update checksum                ;
  10. ;******************************************;
  11.  
  12.         jmps    _check2_end
  13.  
  14. ;--- data
  15.  
  16. _chk_cur        DW      0       ;current checksum value
  17.  
  18. ;========================================
  19. ; Reset checksum.
  20.  
  21. SumRes  PROC    NEAR
  22.         mov     _chk_cur, 0     ;zero checksum
  23.         ret
  24.         ENDP
  25.  
  26. ;========================================
  27. ; Return the current checksum.
  28.  
  29. SumCur  PROC    NEAR
  30.         mov     ax, _chk_cur    ;return checksum
  31.         ret
  32.         ENDP
  33.  
  34. ;========================================
  35. ; Update the current checksum by a byte.
  36.  
  37. SumUpd  PROC    NEAR
  38.         sub     ah, ah          ;zero high byte
  39.         add     _chk_cur, ax    ;update checksum
  40.         ret
  41.         ENDP
  42.  
  43. _check2_end
  44.